home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / GXEnvironment.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  7.8 KB  |  229 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        GXEnvironment.p
  3.  
  4.      Contains:    QuickDraw GX environment constants and interfaces
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT GXEnvironment;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __GXENVIRONMENT__}
  28. {$SETC __GXENVIRONMENT__ := 1}
  29.  
  30. {$I+}
  31. {$SETC GXEnvironmentIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __CONDITIONALMACROS__}
  35. {$I ConditionalMacros.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QUICKDRAW__}
  41. {$I Quickdraw.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __GXTYPES__}
  44. {$I GXTypes.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __CMAPPLICATION__}
  47. {$I CMApplication.p}
  48. {$ENDC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54.  
  55.  
  56. CONST
  57.     defaultPollingHandlerFlags    = $00;
  58.     okToSwitchDuringPollFlag    = $00;
  59.     dontSwitchDuringPollFlag    = $01;
  60.  
  61.  
  62. TYPE
  63.     gxPollingHandlerFlags                = LONGINT;
  64.     gxPollingHandlerProcPtr = ProcPtr;  { PROCEDURE gxPollingHandler(reference: LONGINT; flags: gxPollingHandlerFlags); C; }
  65.  
  66.     gxPollingHandlerUPP = UniversalProcPtr;
  67.  
  68. CONST
  69.     uppgxPollingHandlerProcInfo = $000003C1;
  70.  
  71. FUNCTION NewgxPollingHandlerProc(userRoutine: gxPollingHandlerProcPtr): gxPollingHandlerUPP;
  72.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  73.     INLINE $2E9F;
  74.     {$ENDC}
  75.  
  76. PROCEDURE CallgxPollingHandlerProc(reference: LONGINT; flags: gxPollingHandlerFlags; userRoutine: gxPollingHandlerUPP);
  77.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  78.     {To be implemented:  Glue to move parameters into registers.}
  79.     {$ENDC}
  80. FUNCTION GXGetGraphicsPollingHandler(VAR reference: LONGINT): gxPollingHandlerUPP; C;
  81. PROCEDURE GXSetGraphicsPollingHandler(handler: gxPollingHandlerUPP; reference: LONGINT); C;
  82.  
  83. { QD to QD GX Translator typedefs }
  84.  
  85. CONST
  86.     gxDefaultOptionsTranslation    = $0000;
  87.     gxOptimizedTranslation        = $0001;
  88.     gxReplaceLineWidthTranslation = $0002;
  89.     gxSimpleScalingTranslation    = $0004;
  90.     gxSimpleGeometryTranslation    = $0008;                        {  implies simple scaling  }
  91.     gxSimpleLinesTranslation    = $000C;                        {  implies simple geometry & scaling  }
  92.     gxLayoutTextTranslation        = $0010;                        {  turn on gxLine layout (normally off)  }
  93.     gxRasterTargetTranslation    = $0020;
  94.     gxPostScriptTargetTranslation = $0040;
  95.     gxVectorTargetTranslation    = $0080;
  96.     gxPDDTargetTranslation        = $0100;
  97.     gxDontConvertPatternsTranslation = $1000;
  98.     gxDontSplitBitmapsTranslation = $2000;
  99.  
  100.  
  101. TYPE
  102.     gxTranslationOption                    = LONGINT;
  103.  
  104. CONST
  105.     gxContainsFormsBegin        = $0001;
  106.     gxContainsFormsEnd            = $0002;
  107.     gxContainsPostScript        = $0004;
  108.     gxContainsEmptyPostScript    = $0008;
  109.  
  110.  
  111. TYPE
  112.     gxTranslationStatistic                = LONGINT;
  113.  
  114. CONST
  115.     gxQuickDrawPictTag            = 'pict';
  116.  
  117.  
  118. TYPE
  119.     gxQuickDrawPictPtr = ^gxQuickDrawPict;
  120.     gxQuickDrawPict = RECORD
  121.                                                                         {  translator inputs  }
  122.         options:                gxTranslationOption;
  123.         srcRect:                Rect;
  124.         styleStretch:            Point;
  125.                                                                         {  size of quickdraw picture data  }
  126.         dataLength:                LONGINT;
  127.                                                                         {  file alias  }
  128.         alias:                    gxBitmapDataSourceAlias;
  129.     END;
  130.  
  131. { WindowRecord utilities }
  132. FUNCTION GXNewWindowViewPort(qdWindow: WindowPtr): gxViewPort; C;
  133. FUNCTION GXGetWindowViewPort(qdWindow: WindowPtr): gxViewPort; C;
  134. FUNCTION GXGetViewPortWindow(portOrder: gxViewPort): WindowPtr; C;
  135. { GDevice utilities }
  136. FUNCTION GXGetViewDeviceGDevice(theDevice: gxViewDevice): GDHandle; C;
  137. FUNCTION GXGetGDeviceViewDevice(qdGDevice: GDHandle): gxViewDevice; C;
  138. { gxPoint utilities }
  139. PROCEDURE GXConvertQDPoint({CONST}VAR shortPt: Point; portOrder: gxViewPort; VAR fixedPt: gxPoint); C;
  140.  
  141. TYPE
  142.     gxShapeSpoolProcPtr = ProcPtr;  { FUNCTION gxShapeSpool(toSpool: gxShape; refCon: LONGINT): OSErr; C; }
  143.  
  144. { printing utilities typedef }
  145.     gxUserViewPortFilterProcPtr = ProcPtr;  { PROCEDURE gxUserViewPortFilter(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT); C; }
  146.  
  147.     gxConvertQDFontProcPtr = ProcPtr;  { FUNCTION gxConvertQDFont(dst: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C; }
  148.  
  149.     gxShapeSpoolUPP = UniversalProcPtr;
  150.     gxUserViewPortFilterUPP = UniversalProcPtr;
  151.     gxConvertQDFontUPP = UniversalProcPtr;
  152.  
  153. CONST
  154.     uppgxShapeSpoolProcInfo = $000003E1;
  155.     uppgxUserViewPortFilterProcInfo = $00000FC1;
  156.     uppgxConvertQDFontProcInfo = $00000FF1;
  157.  
  158. FUNCTION NewgxShapeSpoolProc(userRoutine: gxShapeSpoolProcPtr): gxShapeSpoolUPP;
  159.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  160.     INLINE $2E9F;
  161.     {$ENDC}
  162.  
  163. FUNCTION NewgxUserViewPortFilterProc(userRoutine: gxUserViewPortFilterProcPtr): gxUserViewPortFilterUPP;
  164.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  165.     INLINE $2E9F;
  166.     {$ENDC}
  167.  
  168. FUNCTION NewgxConvertQDFontProc(userRoutine: gxConvertQDFontProcPtr): gxConvertQDFontUPP;
  169.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  170.     INLINE $2E9F;
  171.     {$ENDC}
  172.  
  173. FUNCTION CallgxShapeSpoolProc(toSpool: gxShape; refCon: LONGINT; userRoutine: gxShapeSpoolUPP): OSErr;
  174.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  175.     {To be implemented:  Glue to move parameters into registers.}
  176.     {$ENDC}
  177.  
  178. PROCEDURE CallgxUserViewPortFilterProc(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT; userRoutine: gxUserViewPortFilterUPP);
  179.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  180.     {To be implemented:  Glue to move parameters into registers.}
  181.     {$ENDC}
  182.  
  183. FUNCTION CallgxConvertQDFontProc(dst: gxStyle; txFont: LONGINT; txFace: LONGINT; userRoutine: gxConvertQDFontUPP): LONGINT;
  184.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  185.     {To be implemented:  Glue to move parameters into registers.}
  186.     {$ENDC}
  187.  
  188. TYPE
  189.     gxShapeSpoolFunction                = gxShapeSpoolProcPtr;
  190.     gxUserViewPortFilter                = gxUserViewPortFilterProcPtr;
  191.     gxConvertQDFontFunction                = gxConvertQDFontProcPtr;
  192. { mouse utilities }
  193. { return mouse location in fixed-gxPoint global space }
  194. PROCEDURE GXGetGlobalMouse(VAR globalPt: gxPoint); C;
  195. { return fixed-gxPoint local mouse (gxViewPort == 0 --> default) }
  196. PROCEDURE GXGetViewPortMouse(portOrder: gxViewPort; VAR localPt: gxPoint); C;
  197. { printing utilities }
  198. FUNCTION GXGetViewPortFilter(portOrder: gxViewPort; VAR refCon: LONGINT): gxUserViewPortFilterUPP; C;
  199. PROCEDURE GXSetViewPortFilter(portOrder: gxViewPort; filter: gxUserViewPortFilterUPP; refCon: LONGINT); C;
  200. { QD to QD GX Translator functions }
  201. PROCEDURE GXInstallQDTranslator(port: GrafPtr; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStrech: Point; userFunction: gxShapeSpoolUPP; reference: UNIV Ptr); C;
  202. FUNCTION GXRemoveQDTranslator(port: GrafPtr; VAR statistic: gxTranslationStatistic): gxTranslationStatistic; C;
  203. FUNCTION GXConvertPICTToShape(pict: PicHandle; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStretch: Point; destination: gxShape; VAR stats: gxTranslationStatistic): gxShape; C;
  204. { Find the best GX style given a QD font and face. Called by the QD->GX translator }
  205. FUNCTION GXConvertQDFont(theStyle: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C;
  206. FUNCTION GXGetConvertQDFont: gxConvertQDFontUPP; C;
  207. PROCEDURE GXSetConvertQDFont(userFunction: gxConvertQDFontUPP); C;
  208.  
  209. TYPE
  210.     gxProfilePoolAttributes                = LONGINT;
  211.     gxFlatProfileListItemPtr = ^gxFlatProfileListItem;
  212.     gxFlatProfileListItem = RECORD
  213.         attributes:                gxProfilePoolAttributes;                {  information about this particular profile's source }
  214.         profileRef:                CMProfileRef;                            {  reference to profile, only valid before shape is disposed }
  215.         identifier:                CMProfileIdentifier;                    {  information on how to find the profile upon unflattening }
  216.     END;
  217.  
  218.  
  219. {$ALIGN RESET}
  220. {$POP}
  221.  
  222. {$SETC UsingIncludes := GXEnvironmentIncludes}
  223.  
  224. {$ENDC} {__GXENVIRONMENT__}
  225.  
  226. {$IFC NOT UsingIncludes}
  227.  END.
  228. {$ENDC}
  229.